/*
 * File: macros.h - macros available within a sensor node are defined here
 * Author: Sam Tran (tpmsam@yahoo.com), UHCL, April 2006
 */

#define IDX parentModule()->index()

#define ID (int)(parentModule()->par("ID"))

#define CNNCTVTY (int)(parentModule()->par("CNNCTVTY"))

#define FATHER (int)(parentModule()->par("FATHER"))

#define OCCUPATION (int)(parentModule()->par("OCCUPATION"))

#define SENSOR_SWITCH (bool)parentModule()->par("SENSOR_SWITCH")

#define RADIO_SWITCH (bool)parentModule()->par("RADIO_SWITCH")

#define POWER_SWITCH (bool)parentModule()->par("POWER_SWITCH")

#define PX (int)parentModule()->par("PX")

#define PY (int)parentModule()->par("PY")

#define DISTANCE (int)parentModule()->par("DISTANCE")

#define HEAD_DISTRIBUTION (int)parentModule()->par("HEAD_DISTRIBUTION")

//#define FILE_NODE_ENERGY parentModule()->par("FILE_NODE_ENERGY")

//#define FILE_OBJ_TRACE parentModule()->par("FILE_OBJ_TRACE")

#define UPDATECOLOR(color) {\
	char tempstring[30];		    									\
	sprintf(tempstring,"p=%d,%d,exact;b=15,15,oval;o=%s",PX,PY,color);	\
	parentModule()->setDisplayString(tempstring);						}